package com.yss.reportworld.domain;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yss.common.core.annotation.EasyExcel;
import com.yss.common.core.utils.easyexecl.IntegerConverter;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.yss.common.core.web.domain.TreeEntity;

import java.util.Date;
import java.util.List;

/**
 * 客户信息对象 report_world_customer
 *
 * @author yss
 * @date 2023-03-24
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("report_world_customer")
public class Customer extends TreeEntity {

    /**
     * 主键
     */
    @ExcelIgnore
    @TableId("ID")
    private String id;

    /**
     * 客户名称
     */
    @ExcelProperty(value = "客户名称")
    @TableField("NAME")
    private String name;

    /**
     * 状态
     */
    @ExcelProperty(value = "状态", converter = IntegerConverter.class)
    @EasyExcel(readConverterExp = "1=正常,2=停用")
    @TableField("STATUS")
    private Integer status;

    /**
     * 客户是否使用
     */
    @ExcelProperty(value = "状态", converter = IntegerConverter.class)
    @EasyExcel(readConverterExp = "1=正常,2=停用")
    @TableField("IS_USE")
    private Integer isUse;
    /**
     * 客户使用时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("USE_TIME")
    private Date useTime;
    /**
     * 版本号
     */
    @ExcelProperty(value = "版本号")
    @TableField("VERSION")
    private String version;

    /**
     * 客户编码
     */
    @ExcelProperty(value = "客户编码")
    @TableField("CODE")
    private String code;

    /**
     * 许可到期日
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @ExcelProperty(value = "许可到期日")
    @TableField(value = "LICENSE_DUE_TIME", insertStrategy = FieldStrategy.IGNORED, updateStrategy = FieldStrategy.IGNORED)
    private Date licenseDueTime;


    //前台页面查询获取到的集合信息
    // 所属模块
    @ExcelIgnore
    @TableField(exist = false)
    private List<String> listModular;
    //所属报表
    @ExcelIgnore
    @TableField(exist = false)
    private List<String> listReport;


    //许可到期时间，默认一年时间
    @ExcelIgnore
    @TableField(exist = false)
    private String expireDate;

    @ExcelIgnore
    @TableField(exist = false)
    private String username;

    @ExcelIgnore
    @TableField(exist = false)
    private String password;

    /**
     * 历史版本号
     */
    @ExcelIgnore
    @TableField(exist = false)
    private String hisVersion;
}
